#!/usr/bin/python3
# ******************************************************************************
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
# licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
#     http://license.coscl.org.cn/MulanPSL2
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
# PURPOSE.
# See the Mulan PSL v2 for more details.
# ******************************************************************************/
"""
Global environment variable value when the tool is running
"""

import os

# oect top dir
LIBS_CONFIG_FOLDER = os.path.abspath(os.path.dirname(__file__))
# path of user-agent.json
USER_AGENT_JSON = f'{LIBS_CONFIG_FOLDER}/user-agent.json'
# gitee api config
GITEE_API_CONFIG = f'{LIBS_CONFIG_FOLDER}/gitee_api_config.yaml'
# gitee memebers id
GITEE_OE_MEMBERS_ID_YAML = f'{LIBS_CONFIG_FOLDER}/oe_memebers_id.yaml'
# openEuler_full_repos
GITEE_OE_FULL_REPO_SIGS = f'{LIBS_CONFIG_FOLDER}/oe_full_repos.yaml'
# latest openEuler_full_repos
GITEE_LATEST_OE_FULL_REPO_SIGS = f'{LIBS_CONFIG_FOLDER}/latest_oe_full_repos.yaml'
# openeuler package id
GITEE_OE_PACKAGE_ID_YAML = "%s/oe_package_id.yaml" % (LIBS_CONFIG_FOLDER)
# provides data of  mainline primary.yaml
MAINLINE_PROVIDES_YAML = f'{LIBS_CONFIG_FOLDER}/mainline_provides.yaml'

LOCAL_REPO_EXCEP = f'{LIBS_CONFIG_FOLDER}/pdfs.yaml'
LOCAL_OPENEULER_OWNERS = f'{LIBS_CONFIG_FOLDER}/openEuler-owner-real.csv'
LOCAL_OE_REPO_ASSIGNEE_YAML = f'{LIBS_CONFIG_FOLDER}/oe_repo_assignee.yaml'

LOCAL_SIGS = '../community/sig/'
LOCAL_SIGS_INFO_YAML = LOCAL_SIGS + '{signame}/sig-info.yaml'
LOCAL_SIGS_OWNERS = LOCAL_SIGS + '{signame}/OWNERS'

# release-management
RELEASE_BASE_LINE_EVERYTHING_YAML = f'{LIBS_CONFIG_FOLDER}/release_base_line/everything.yaml'
RELEASE_BASE_LINE_EPOL_YAML = f'{LIBS_CONFIG_FOLDER}/release_base_line/epol.yaml'
RELEASE_BASE_LINE_BASEOS_YAML = f'{LIBS_CONFIG_FOLDER}/release_base_line/baseos.yaml'

# baseos_primary.xml
DAILY_BASEOS_PRIMARY_XML = "%s/{branch}-baseos-primary.xml" % (LIBS_CONFIG_FOLDER)
# mainline_primary.xml
DAILY_EVERYTHING_PRIMARY_XML = "%s/{branch}-everything-primary.xml" % (LIBS_CONFIG_FOLDER)
# epol_primary.xml
DAILY_EPOL_PRIMARY_XML = "%s/{branch}-epol-primary.xml" % (LIBS_CONFIG_FOLDER)
# multi_version.xml
MULTI_VERSION_PRIMARY_XML = "%s/{branch}-epol-multi-version-primary.xml" % (LIBS_CONFIG_FOLDER)

# mainline_primary.xml
OBS_MAINLINE_PRIMARY_XML = "%s/obs-openEuler-22.09-source.primary.xml" % (LIBS_CONFIG_FOLDER)
# epol_primary.xml
OBS_EPOL_PRIMARY_XML = "%s/obs-openEuler-22.09-EPOL-source.primary.xml" % (LIBS_CONFIG_FOLDER)

# binary with src of Mainline
MAINLINE_BINARY_2_SRC_YAML = "%s/everything_bin_2_src.yaml" % (LIBS_CONFIG_FOLDER)
# binary with src of Epol
EPOL_BINARY_2_SRC_YAML = "%s/epol_bin_2_src.yaml" % (LIBS_CONFIG_FOLDER)
FULL_BINARY_2_SRC_YAML = "%s/full_bin_2_src.yaml" % (LIBS_CONFIG_FOLDER)

# OBS 实时日志链接
DEFAULT_OSCRC_APIURL = "https://build.openeuler.org"
OBS_PROJECT_LIVE_LOG= DEFAULT_OSCRC_APIURL + "/package/live_build_log/{obs_project}/{package}/{repo}/{arch}"

# OBS 记录版本单包构建问题仓库地址
OE_PACKAGE_PROBLEMS_RECORD_PATH = "Oect:Record:Package:Problems/{oe_version}/"